Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global form submissions #76

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

JeffersonBledsoe
Copy link
Member

@JeffersonBledsoe JeffersonBledsoe commented Jan 31, 2025

This PR adds the ability for forms to be sent from outside the page they are on. The reasoning for this is so forms can be created elsewhere and inserted into a page, such as with a slots/ portlets mechanism.
This is achieved by creating a global_forms registry where forms are stored with a global_block_id which is generated on block save and saved with the block. If the client sends a form submission which matches against a global block id, that global form will be used.

TODO

  • Save data action

@JeffersonBledsoe JeffersonBledsoe changed the title WIP: Global form submissions Global form submissions Feb 6, 2025
@djay
Copy link
Member

djay commented Feb 10, 2025

@mamico This is now working for us for our needs (as described in collective/volto-form-block#123). It is however a fairly big architectural change. Any comments on this approach? is it worth us finishing or there is no chance of getting this merged?

@mamico
Copy link
Contributor

mamico commented Feb 13, 2025

@mamico This is now working for us for our needs (as described in collective/volto-form-block#123). It is however a fairly big architectural change. Any comments on this approach? is it worth us finishing or there is no chance of getting this merged?

@JeffersonBledsoe @djay I don't have a clear opinion, but at first glance, it does seem that handling the form definition and data in a centralized way aligns less with the Plone/Volto model. Have you considered an alternative like volto-repeatable-content-block, or maybe I didn't fully understand, or it doesn't entirely cover your use case?

In any case, I would also check with @sneridagh and @robgietema, as they have been working extensively on the long-term rework of the product (collective/volto-form-block#110).

@djay
Copy link
Member

djay commented Feb 13, 2025

The usecase is a form in a slot. Our slots editor allows this. For instance a below content slot or a form in a footer.

It's not about what is the plone way to handle it. Is it a good idea to store form data in page and have that removed when the page is removed? Ir have the data not follow the form if it's moved from one page to another. I would argue not. I would argue that it's better to have a central control panel that lets you view the data collected by forms and remove or manage them with visibility.

But in any case the current PR does not choose to change the default of storing data in the page if the page is available. It only stores it centrally if the page is not available such as the case with slots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't have forms shared across many pages
3 participants